import request from '@/utils/request'

export function listOrder(pos, size, conditions) {
  return request({
    url: '/order/list',
    params: {
      'pos': pos,
      'size': size,
      'conditions': JSON.stringify(conditions)
    },
    method: 'get'
  })
}
export function delOrder(ordermodel) {
  return request({
    url: '/order/del',
    data: ordermodel,
    method: 'post'
  })
}
export function delOrders(jsonOrderModel) {
  return request({
    url: '/order/bulkdel',
    data: {
      data: jsonOrderModel
    },
    method: 'post'
  })
}

export function setOrder(ordermodel, orderdetail) {
  return request({
    url: '/order/set',
    data: {
      main: JSON.stringify(ordermodel),
      detail: JSON.stringify(orderdetail)
    },
    method: 'post'
  })
}

export function approveOrder(ordermodel) {
  return request({
    url: '/order/approve',
    data: ordermodel,
    method: 'post'
  })
}
export function get(id) {
  return request({
    url: '/order/get',
    params: {
      'id': id
    },
    method: 'get'
  })
}
